package com.greenold.service.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.greenold.service.mapper.CareLevelMapper;
import com.greenold.service.domain.CareLevel;
import com.greenold.service.service.ICareLevelService;

/**
 * 护理等级Service业务层处理
 *
 * @author YueYang
 * @date 2025-10-13
 */
@Service
public class CareLevelServiceImpl implements ICareLevelService {
    @Autowired
    private CareLevelMapper careLevelMapper;

    /**
     * 查询护理等级
     *
     * @param id 护理等级主键
     * @return 护理等级
     */
    @Override
    public CareLevel selectCareLevelById(String id) {
        return careLevelMapper.selectCareLevelById(id);
    }

    /**
     * 查询护理等级列表
     *
     * @param careLevel 护理等级
     * @return 护理等级
     */
    @Override
    public List<CareLevel> selectCareLevelList(CareLevel careLevel) {
        return careLevelMapper.selectCareLevelList(careLevel);
    }

    /**
     * 新增护理等级
     *
     * @param careLevel 护理等级
     * @return 结果
     */
    @Override
    public int insertCareLevel(CareLevel careLevel) {
        return careLevelMapper.insertCareLevel(careLevel);
    }

    /**
     * 修改护理等级
     *
     * @param careLevel 护理等级
     * @return 结果
     */
    @Override
    public int updateCareLevel(CareLevel careLevel) {
        return careLevelMapper.updateCareLevel(careLevel);
    }

    /**
     * 批量删除护理等级
     *
     * @param ids 需要删除的护理等级主键
     * @return 结果
     */
    @Override
    public int deleteCareLevelByIds(String[] ids) {
        return careLevelMapper.deleteCareLevelByIds(ids);
    }

    /**
     * 删除护理等级信息
     *
     * @param id 护理等级主键
     * @return 结果
     */
    @Override
    public int deleteCareLevelById(String id) {
        return careLevelMapper.deleteCareLevelById(id);
    }

    /**
     * 修改护理等级状态
     *
     * @param id 根据id修改护理等级状态
     * @return 返回影响行数
     */
    @Override
    public int changeStatus(Integer id, String status) {
        return careLevelMapper.changeStatus(id, status);
    }

    /**
     * 查询老人表获取绑定的所有护理等级id
     *
     * @return 所有护理等级id列表
     */
    @Override
    public List<Long> getBindCareLevelIds() {
        return careLevelMapper.getBindCareLevelIds();
    }
}
